﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using ToDoClear;
using System.Windows.Threading;
using ToDoClear.Motion;

namespace ToDoClear.HandleLogic
{
    public class VerDragHandle : GestureHandle
    {
        private const string TAG = "VerDragHandle";
        public MainState GetSupportState()
        {
            return MainState.VerDrag;
        }

        public void DragCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            Log.d(TAG, "DragCompleted");

            ScrollMotion motion = new ScrollMotion(ToDoCanvas.getInstance().cuList);
        }

        public void DragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            Log.d(TAG, "DragDelta");

            Point cuPoint = e.GetPosition(ToDoCanvas.getInstance().RootCanvas);
          
            ToDoCanvas.getInstance().cuList.RefreshVerDragOffset(cuPoint);
          
          
        }

        public void DragStarted(object sender, DragStartedGestureEventArgs e)
        {
            Log.d(TAG, "DragStarted");
         


        }

        public void Flick(object sender, FlickGestureEventArgs e)
        {
            ScrollMotion motion = new ScrollMotion(ToDoCanvas.getInstance().cuList, e.VerticalVelocity);

            Log.d(TAG, "Flick:"+e.VerticalVelocity);
          
        }

        public void GestureBegin(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            Log.d(TAG, "GestureBegin");

        }

        public void GestureCompleted(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            Log.d(TAG, "GestureCompleted");
            
        }

        public void PinchCompleted(object sender, PinchGestureEventArgs e)
        {
            Log.d(TAG, "PinchCompleted");

        }

        public void PinchDelta(object sender, PinchGestureEventArgs e)
        {
            Log.d(TAG, "PinchDelta");

        }

        public void PinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            Log.d(TAG, "PinchStarted");

        }

        public void Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            Log.d(TAG, "Tap");

        }

        public void Hold(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            Log.d(TAG, "Hold");

        }

    }
}
